<template>
  <div>
    <h3>当前的count值:{{ $store.state.count }}</h3>
    <button @click="btnAdd">+1</button>
    <button @click="btnAddAsync">异步+1</button>
    <button @click="btnAddAsyncParams">异步+step参数</button>
    <button @click="AddAsyncParams1">异步+step参数 1</button>
  </div>
</template>

<script>
// 导入 mapActions 函数
import { mapActions } from 'vuex'
export default {
  data() {
    return {}
  },
  methods: {
    btnAdd() {
      this.$store.commit('add')
    },
    btnAddAsync() {
      this.$store.dispatch('addAsync')
    },
    btnAddAsyncParams() {
      this.$store.dispatch('addAsyncParams')
    },
    ...mapActions(['addAsyncParams1'])
  }
}
</script>

<style>
</style>